//
//  CarNumController.m
//  PropertyMananger
//
//  Created by bh on 17/1/4.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "CarNumController.h"

#import "CarNumQueryDetailCell.h"

@interface CarNumController ()<UISearchBarDelegate>
/**数据源**/
@property (nonatomic,strong) NSArray * infoArray;
@property (nonatomic,strong) NSArray * titleArray;
@property (nonatomic,strong) NSArray * iconArray;
@end

@implementation CarNumController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    [self initTitleViewName:@"车牌号查询详情"];
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self initTableViewWithView:self.view frame:CGRectMake(0, 0, BHscreenW, BHscreenH) isGroup:NO];
    self.tableView.backgroundColor = BHColor(238, 238, 238);
    [self getData];
}

#pragma mark - 数据源
- (void)getData
{

    self.iconArray = @[@"ico_parking_lot_state",@"ico_parking_lot_number",@"ico_parking_lot_name",@"ico_parking_lot_phone"];
    //标题
    self.titleArray = @[@"车位编号",@"车牌号",@"车主姓名",@"车主电话"];
    //详细信息
   // self.infoArray = [NSMutableArray arrayWithObjects:@"D6038",@"陈小黑",@"12345678653", nil];

}
#pragma mark - 代理方法
#pragma mark - tableview代理方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.iconArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    CarNumQueryDetailCell * carNumCell= [CarNumQueryDetailCell cellWithTableView:tableView];
    carNumCell.imgView.image = IMG(self.iconArray[indexPath.row]);
    carNumCell.titleLabel.text = self.titleArray[indexPath.row];
    if (indexPath.row == 0) {
        
        carNumCell.infoLabel.textColor = Theme_Color;
        carNumCell.infoLabel.text = self.model.ParkingCode;
        DLog(@"车牌号 === %@",self.model.CarNo);
        
    }else if (indexPath.row == 1){
        carNumCell.infoLabel.text = self.model.CarNo;
    }else if (indexPath.row == 2){
        carNumCell.infoLabel.text = self.model.Name;
    }else if (indexPath.row == 3){
        carNumCell.infoLabel.text = self.model.Phone;
    }
    return carNumCell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}

@end
